home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / source / suntar1.cpt / how to create .dump files < prev    next >
Encoding:
Text File  |  1992-06-20  |  1.1 KB  |  30 lines

  1. How to create suntar.dump and suntar.uu
  2.  
  3. A disk dump may be created by the "Save sectors" command. Conceptually,
  4. you could save all the sectors in the disk (from sector 0 to 2879 if
  5. it's a 1440K) but it's better to save space by saving only what is
  6. necessary:
  7. a) a deleted file may still occupy space in the dump file, hence it's
  8.    better to dump a disk which was formatted just before filling it
  9. b) the public domain utility "1430K free" may save 20 extra Kilobytes
  10.    (we've used it since suntar1.1.uu)
  11. c) on our first attempt we searched the first unused sector by View sector,
  12.    but from the second time we've used this routine:
  13.  
  14. unsigned short buffer[256];
  15. long l;
  16. read_one_sector(2,buffer);
  17. if(err_code || buffer[0]!= 0x4244) exit(0);    /* only HFS has a bitmap */
  18. l= buffer[9];    /* number of allocation blocks */
  19. read_one_sector(3,buffer);    /* the first sector of the bitmap (the
  20.     only sector of the bitmap in a volume with no more then 4100 sectors) */
  21. do
  22.     l--;
  23. while(! BitTst(buffer,l));
  24. l += 5;
  25. printf("First unused sector:%ld\n",l);
  26.  
  27. d) do a Save sector from 1 to the last used sector: that's the .dump file
  28.  
  29.  Finally, use any uuencoder to build the .uu file
  30.